import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router'

import Home from "@/views/Home.vue";
import QuestionsAnswers from "@/views/system/questionsAnswers.vue";
import Retrieval from "@/views/system/retrieval.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    component: Home,
    redirect: "/system/questionsAnswers",
    meta: {
      title: "home",
      name: "home",
    },
    children: [
      {
        path: "system/questionsAnswers",
        name: "QuestionsAnswers",
        component: QuestionsAnswers,
        meta: {
          title: "智能问答",
          name: "questionsAnswers",
          keepAlive: true
        },
      },
      {
        path: "system/retrieval",
        name: "Retrieval",
        component: Retrieval,
        meta: {
          title: "智能检索",
          name: "retrieval",
          keepAlive: true
        },
      },
    ]
  },
];


const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
